package com.fanco.learn_datastruct_leetcode.designpattern.composite;

/**
 * @author qiaowang 2022/2/15
 * 描述
 */
public abstract class OrganizationComponent {

    private String name; // 名字

    private String desc; // 描述

    protected void add (OrganizationComponent organizationComponent) {
        // 默认实现
        throw new UnsupportedOperationException();
    }

    protected void remove (OrganizationComponent organizationComponent) {
        // 默认实现
        throw new UnsupportedOperationException();
    }

    public OrganizationComponent(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    // 方法 print ,抽象方法子类都需要实现。
    protected abstract void print();
}
